<template>
  <div class="advise">
    <group>
      <x-textarea placeholder="请输入您的投诉建议" :max="200" :height="198" v-model="advise"></x-textarea>
    </group>
    <agent-button :disabled="enable" class="submit" type="primary" @btnClick="submit">确认提交</agent-button>
  </div>
</template>
<script>
import { XTextarea, Group } from "vux";
import AgentButton from "../../components/common/AgentButton.vue";
export default {
  data() {
    return {
      advise: ""
    };
  },
  components: {
    XTextarea,
    Group,
    AgentButton
  },
  computed: {
    enable() {
      if (this.advise) {
        return false;
      }
      return true;
    }
  },
  methods: {
    submit() {
      this.apiService.feedback
        .addfeedback({
          content: this.advise
        })
        .then(res => {
          this.$vux.toast.text("您的反馈已经成功提交");
        });
    }
  }
};
</script>
<style scoped>
.advise {
  text-align: center;
}
.submit {
  background-color: #108ee9;
  border-radius: 0.1rem;
  margin-top: 0.6rem;
  width: 90%;
}
</style>


